<?php
	include_once 'autoload.php';
	

	session_start();

	$ctl = new ConfirmPictureCtl();
	$ctl->checkLogged();
	$ctl->checkNotReadonly();
	$ctl->proceed();
	
	$header = new Header();
	$header->render('Confirm Delete Picture');

	$form = $ctl->getConfirmPictureForm();

	$pictures = $form->getPictures();
?>
<form method="post">
<input type="hidden" name="pagename" value="confirmpicture" id="pgid">
<input type="hidden" name="metname" value="" id="metid">

<h2>Confirm Delete</h2>
<table cellpadding="8" cellspacing="0" class="pictures">
<?php
	foreach($pictures as $current){
		$id = $current->getId();
		$name = htmlspecialchars($current->getComments());

		$url = "smallimage.php?id={$id}";
?>
	<tr>
		<td class="label"><div style="width: 200px; text-align: left; "><?php echo $name; ?></div></td>
		<td class="label"><img src="<?php echo $url; ?>"></td>
	</tr>
<?php 
	} // foreach
?>
</table>

<p>
	<input type="button" value="Confirm" onclick="triggerform('submit')" class="enter">
	<input type="button" value="Cancel" onclick="triggerform('cancel')" class="escape">
</p>
</form>
<?php
	$footer = new Footer();
	$footer->render();
?>
